<?php

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query;

class DefaultDb_Repositories_LogVehicleDriverRepository extends EntityRepository
{

    public function addLog(DefaultDb_Entities_Vehicle $vehicle, DefaultDb_Entities_User $driver, DefaultDb_Entities_User$user)
    {
        $em = $this->getEntityManager();
        $newRecord = new DefaultDb_Entities_LogVehicleDriver();
        $newRecord->setVehicle($vehicle);
        $newRecord->setDriver($driver);
        $newRecord->setUser($user);
        $em->persist($newRecord);
        $em->flush();
        return $newRecord;
    }

}